home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #48 (1995-06-25)(PackMAN)(DE)[WB].zip / Purity #48 (1995-06-25)(PackMAN)(DE)[WB].adf / Konverter / Dec_Bin_Bit.p next >
Text File  |  1995-06-24  |  401b  |  27 lines

  1. program hallo;
  2. var
  3. i,j,l,h:integer;
  4.  
  5.  
  6.  function Bit_gesetzt (byt: integer; n: integer): boolean;
  7.  begin
  8.  
  9.   bit_gesetzt := ( byt and ( 1 shl n ) ) = 1 shl n;
  10.  
  11.  end;
  12.  
  13.    begin
  14.  
  15.     write('Zahl eingeben : ');
  16.    readln(l);
  17.   writeln('Zahl in 16-Bit-Darstellung:');
  18.   for j := 15 downto 0 do
  19.    if BIT_gesetzt(l, j) then
  20.     write('1')
  21.    else
  22.     write('0');
  23.   writeln;
  24.                 readln;
  25.     end.
  26.  
  27.